﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZX_3_SchoolManage_IDAL;
using ZX_3_SchoolManage_Model;
using ZX_3_SchoolManage_Factory;

namespace ZX_3_SchoolManage_BLL
{
    public class TeachersManage_BLL
    {
        static AbstractFactory F1 = AbstractFactory.ChangeDateBase();
        TeacherManage_IDAL Tdal = F1.TeacherIDALSQL();
        /// <summary>
        /// 分页显示
        /// </summary>
        /// <param name="TeaName"></param>
        /// <param name="pagesize"></param>
        /// <param name="pageindex"></param>
        /// <returns></returns>
        public Page<TeacherModel> Teacher_show(string TeaName, int pagesize, int pageindex)
        {
            Page<TeacherModel> p = new Page<TeacherModel>();
            p.pageindex = pageindex;
            p.pagesize = pagesize;
            p.pagecount = Tdal.pagecount(TeaName);
            p.Teacher = Tdal.getTeachershow(TeaName, pagesize, pageindex);
            return p;
        }
         /// <summary>
        /// 模糊查询总条数
        /// </summary>
        /// <param name="TeaName"></param>
        /// <returns></returns>

        public int pagecount(string TeaName)
        {
            return pagecount(TeaName);
        }
        /// <summary>
        /// 添加教师数据
        /// </summary>
        /// <param name="T"></param>
        /// <returns></returns>
        public int Add(TeacherModel T)
        {
            return Tdal.Add(T);
        }
        /// <summary>
        /// 修改教师数据
        /// </summary>
        /// <param name="Te"></param>
        /// <returns></returns>
        public int Edit(TeacherModel Te)
        {
            return Tdal.Edit(Te);
        }
      
    }
}
